<!DOCTYPE html>
<html lang="zh">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <link href="../static/css/prism.css" rel="stylesheet" />
    <link href="../static/css/style.css" rel="stylesheet" />
    <title>Document</title>
</head>
<body>
    <h2>函数名的提升</h2>
    <p>js语言在执行整段代码时，会先扫描整段代码，对于函数的声明，会将函数名提升</p>
    <p>即，<strong>可以先调用函数，然后再声明函数</strong></p>
    <pre><code class="language-javascript">foo();

function foo(){
    console.log("hello");
}</code></pre>

    <script src="../static/js/prism.min.js"></script>
</body>
</html>